import org.molamil.acto.pages.PageContext;

/**
 * XXX: Comment.
 * 
 * @author Jorge Hernandez
 */
class org.molamil.acto.pages.preload.PageLoad {
	
	
	// Properties
	
	private var _page:PageContext;
	private var _mcl:MovieClipLoader;	private var _target_mc:MovieClip;
	private var _timeStart:Date;
	private var _timeEnd:Date;
	private var _bytesLoaded:Number;
	private var _bytesTotal:Number;
	private var _totalframes:Number;
	
	
	// Getter/Setter
	
	public function get page():PageContext {
		return _page;
	}
	
	public function set page(page:PageContext):Void {
		_page = page;
	}
	
	public function get mcl():MovieClipLoader {
		return _mcl;
	}
	
	public function set mcl(mcl:MovieClipLoader):Void {
		_mcl = mcl;
	}
	
	public function get target_mc():MovieClip {
		return _target_mc;
	}
	
	public function set target_mc(target_mc:MovieClip):Void {
		_target_mc = target_mc;
	}
	
	public function get timeStart():Date {
		return _timeStart;
	}
	
	public function set timeStart(timeStart:Date):Void {
		_timeStart = timeStart;
	}
	
	public function get timeEnd():Date {
		return _timeEnd;
	}
	
	public function set timeEnd(timeEnd:Date):Void {
		_timeEnd = timeEnd;
	}
	
	public function get bytesLoaded():Number {
		return _bytesLoaded;
	}
	
	public function set bytesLoaded(bytesLoaded:Number):Void {
		_bytesLoaded = bytesLoaded;
	}
	
	public function get bytesTotal():Number {
		return _bytesTotal;
	}
	
	public function set bytesTotal(bytesTotal:Number):Void {
		_bytesTotal = bytesTotal;
	}
	
	public function get totalframes():Number {
		return _totalframes;
	}
	
	public function set totalframes(totalframes:Number):Void {
		_totalframes = totalframes;
	}
	
	public function get time():Number {
		if (_timeEnd != null) {
			return _timeEnd.getTime() - _timeStart.getTime();
		} else {
			return new Date().getTime() - _timeStart.getTime();
		}
	}
	
	public function get isCompleted():Boolean {
		return _timeEnd != null;
	}
	
	
}